
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ page import="mybatis.pojo.Grade" %>
<%@ page import="mybatis.pojo.Subject" %>
<%@ page import="mybatis.services.GradeService" %>
<%@ page import="mybatis.services.SubjectService" %>
<%@ page import="java.util.List" %>
<script src="js/jquery.js"></script>

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>学生管理系统</title>
    <link rel="stylesheet" href="css/public.css"/>
    <link rel="stylesheet" href="css/style.css"/>
</head>
<body>
<%
    request.setCharacterEncoding("utf-8");
    Subject subject =(Subject)request.getAttribute("subject");
    List<Grade> all = ( List<Grade>)request.getAttribute("all");
%>


<!--主体内容-->
<%@include file="/checkLogin.jsp"%>
<section class="publicMian ">
<div class="right">
    <div class="location">
        <strong>你现在所在的位置是:</strong>
        <span>课程管理页面 >> 课程修改页</span>
    </div>
    <div class="providerAdd">
        <form action="subjectUpdate" method="post">
            <!--div的class 为error是验证错误，ok是验证成功-->
            <div class="">
                <label for="providerId">课程id：</label>
                <input type="text"  name="id"  VALUE="<%=subject.getId()%>" readonly/>
                <span>*</span>
            </div>
            <div >
                <label for="providerId">请输入课程名称：</label>
                <input type="text"  name="subName" id="providerId" value="<%=subject.getSubjectname()%>"/>
                <span>*</span>
            </div>
            <div>
                <label for="providerName">请输入课程学时：</label>
                <input type="number" name="classHour" id="providerName" value="<%=subject.getClasshour()%>"/>
                <span >*</span>
            </div>
            <div>
                <label>请选择年级信息：</label>
                <select name="gradeId" id="gradeId">
                    <%
                        for (Grade grade : all) {
                    %>
                    <option value="<%=grade.getId()%>"><%=grade.getGname()%></option>
                    <% } %>
                </select>
                <span></span>

            </div>
            <div>
                <span>*</span>
            </div>
            <div>
                <span>*</span>

            </div>
            <div>
                <span>*</span>

            </div>
            <div>
                <span>*</span>

            </div>
            <div class="providerAddBtn">
                <!--<a href="#">保存</a>-->
                <!--<a href="providerList.html">返回</a>-->
                <input type="submit" value="保存" onclick="history.back(-1)"/>
                <input type="button" value="返回" onclick="history.back(-1)"/>
            </div>
        </form>
    </div>

</div>
</section>
<script>
    $(function () {
        $("#gradeId").val(<%=subject.getGradeid()%>);
    })
</script>
<footer class="footer">
</footer>
<script src="js/time.js"></script>

</body>
</html>